<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>立即消费</title>
<!--公共样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/reset.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/common.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Plugins/FontAwesome/css/font-awesome.min.css">
<!--公共样式结束-->
<!--页面样式开始-->
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/module_form.css">
<link rel="stylesheet" type="text/css" href="{$NOW_THEME_URL}/Assets/Css/page_startTime.css">
<!--页面样式结束--
<!--公共JS开始-->
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.min.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/jquery.timer.js"></script>
<script src="{$NOW_THEME_URL}/Assets/Js/common.js"></script>
<!--公共JS结束-->
<style type="text/css">
	body {
		overflow:hidden;
	}
</style>
</head>

<body>
	<div class="yhlist clearfix">
		<div class="table_box1">
			<form action="" method="post" id="memberAdd_form">
				<table cellpadding="0" cellspacing="0" class="module_form" width="100%">
					<tr>
						<td colspan="4" class="jctitle">计时基本信息</td>
					</tr>
					<tr>
						<td class="center"><label for="jici">计时项目</label></td>
						<td class="left">
							<select class="width_100" name="id" id="id" id="level">
								<volist name="proList" id="v">
									<option value="{$v.id}" <eq name="v.id" value="$pid">selected</eq>>{$v.ctitle}</option>
								</volist>
							</select>
						</td>
					</tr>
					<tr>
						<td class="center"><label for="yajin">预交押金</label></td>
						<td class="left"><input name="rent" type="text" id="rent" class="form_ele_text width_100">元
						</td>
					</tr>
					<tr>
						<td class="center"><label for="yajin">备注</label></td>
						<td class="left"><input name="content" type="text" id="content" class="form_ele_text width_150">
						</td>
					</tr>
					<tr>
						<td class="center"><label for="jici">消费时间</label></td>
						<td class="left xs">
							<span><input onClick="showyhj(2)" type="radio" value="1" name="limittime" checked>不限时</span>
							<input onClick="showyhj(1)" type="radio" value="2" name="limittime">限时
						</td>
					</tr>
					<tr class="timetext" style="display:none;">
						<td class="center"><label for="jici">时间</label></td>
						<td class="left">
							<input name="amount" type="text" id="amount" class="form_ele_text width_100 timet">单位：
							<select name="unit" id="unit">
								<volist name="timeArr" id="v">
									<neq name="key" value="title">
										<option value="2" <eq name="key" value="2">selected</eq>>{$v}</option>
									</neq>
								</volist>
							</select>
						</td>
					</tr>
				</table>
			</form>
			<div class="xiaofei">
				<a class="form_ele_submit">确定</a>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
	//表格隔行换色
	$('.module_form tr:odd').addClass('odd');
	$('.module_form tr:even').addClass('even');
	
	$(function(){
		
		$(".form_ele_submit").on('click',function(){
			
			var tipsObj = windowApi.lhgdialog.tips('正在提交数据...',10,etIcon.loading);
			
			//通过Ajax提交表单
			var postData = {};
			postData.id     = $('#id').val(); //备注
			postData.rent   = $('#rent').val(); //备注
			postData.amount = $('#amount').val(); //备注
			postData.unit   = $('#unit').val(); //备注
			postData.content= $('#content').val(); //备注
			
			$.post("{:U('Sell/timeAdd')}", postData ,function(data){
					tipsObj.close();
					frameApi.close(); //关闭当前窗口 
					if(data.status==1){
						var obj = windowApi.lhgdialog.list['Sell_sellTime'];
						obj.reload(obj); //指定刷新某个窗口
					}else{
						windowApi.lhgdialog.tips(data.info,2,etIcon.error);
					}
				}, "json"
			);
		});
	});
	
	//限时文本框显示隐藏
	function showyhj(id){
		if(id==1){
			$(".timet").show();
			$(".timetext").show();
		}else{
			$(".timet").hide();
			$(".timetext").hide();
		}
		if(id==2){
			$(".timet").hide();
			$(".timetext").hide();
		}
	}
</script>
</html>
